﻿@model PhoneBilling.Models.TraiffMgtModel
@{
    ViewBag.Title = "费率表维护";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">
    function del(id, name) {
        var r = confirm("确认删除费率表：" + name + "吗？");
        if (r == true) {
            window.location.href = "/Manage/DeleteTraiff?id=" + id;
        }
        return false;
    }
</script>
@if (Model.Message != null){<h2>@Model.Message</h2>}
<script type="text/javascript">
    function modifyTraiff(id) {
        window.location.href = "/Manage/TraiffEdit?id="+id;
    }

    function deleteTraiff(id) {
        var msg = "确定删除费率表(" + id + ")？";
        var result = confirm(msg);
        if (result == true)
            window.location.href = "/Manage/DeleteTraiff?id=" + id;
    }
</script>
<p id="btn-create" class="box"><a href="/Manage/TraiffEdit"><span>新增费率表</span></a></p>
@{
    var grid = new WebGrid(source: Model.TraiffList, rowsPerPage: 30);
}
@grid.GetHtml(
    alternatingRowStyle: "bg",
    columns:grid.Columns
    (
        grid.Column("Name","费率表"),
        grid.Column("Remark", "备注"),
        grid.Column(format:(item)=> Html.ActionLink("修改","TraiffEdit",new {id=item.ID})),
        grid.Column(format: (item) => Html.Raw(string.Format("<a href='javascript:' onclick=\"del('{0}','{1}')\">删除</a>", item.ID, item.Name)))
    )
)
@*<table>
    <tr>
        <th>费率表</th>
        <th></th>
        <th></th>
    </tr>
    @{
        foreach (var detail in Model.TraiffList)
        {
        <tr>
            <td>@detail.Name</td>
            <td><input type="button" value="修改" class="input-submit-02" onclick="modifyTraiff('@detail.ID')" /></td>
            <td><input type="button" value="删除" class="input-submit-02" onclick="deleteTraiff('@detail.ID')" /></td>
        </tr>
        }
    }
</table>*@


